import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DissentVO, DissentForm, DissentQuery } from '@/api/xydz/dissent/types';

//信用查询记录列表
export const getQueryList = (query?: DissentQuery): AxiosPromise<DissentVO[]> => {
  return request({
    url: '/xydz/credit/record/reportList',
    method: 'get',
    params: query
  });
};

//信用授权查询记录列表
export const getQueryByCodeList = (query?: DissentQuery): AxiosPromise<DissentVO[]> => {
  return request({
    url: '/xydz/credit/record/authList',
    method: 'get',
    params: query
  });
};

//信用授权记录列表
export const getAuthList = (query?: DissentQuery): AxiosPromise<DissentVO[]> => {
  return request({
    url: '/xydz/credit/record/authList',
    method: 'get',
    params: query
  });
};

//信用核验记录列表
export const getVerifyList = (query?: DissentQuery): AxiosPromise<DissentVO[]> => {
  return request({
    url: '/xydz/credit/record/verifyList',
    method: 'get',
    params: query
  });
};

//信用异议记录列表
export const getDissentList = (query?: DissentQuery): AxiosPromise<DissentVO[]> => {
  return request({
    url: '/xydz/credit/record/dissentList',
    method: 'get',
    params: query
  });
};

//信用用户记录列表
export const getUserList = (query?: DissentQuery): AxiosPromise<DissentVO[]> => {
  return request({
    url: '/xydz/credit/record/loginList',
    method: 'get',
    params: query
  });
};

//核验
export const verifyCode = (id: string): AxiosPromise<DissentVO[]> => {
  return request({
    url: `/credit/report/verify/${id}`,
    method: 'get'
  });
};

//查看报告详情
export const getReportDetail = (id: string): AxiosPromise<DissentVO[]> => {
  return request({
    url: `/xydz/credit/report/${id}`,
    method: 'get'
  });
};

//预览报告
export const previewReport = (id: string) => {
  return request({
    url: '/xydz/credit/report/preview/' + id,
    method: 'get',
    params: {}
  });
};

//预览佐证材料
export const previewEvidence = (id: string) => {
  return request({
    url: '/xydz/credit/report/previewEvidence/' + id,
    method: 'get',
    params: {}
  });
};
